import { reactive,onMounted } from 'vue'
import { defineStore } from 'pinia'
import { getGoodsAPI } from '@/apis/home'

export const useProductStore = defineStore('product',() => {
    const productList = reactive([])

    const getProductList = async () => {
            const {result} = await getGoodsAPI()
            Object.assign(productList,result)
            console.log(productList)
        }

        onMounted(() => {
            getProductList()
        })

        return { productList }
})